package com.shop.front.dao.store;


import com.shop.jpa.BaseSQLDao;
import com.shop.jpa.support.QuerySQL;
import com.shop.front.vo.store.StoreCategoryVo;
import com.shop.web.context.WebContext;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class StoreCategorySQLDao extends BaseSQLDao {


    public List<StoreCategoryVo> findList() {
        String field = "*";
        String from = "t_store_category sc";
        String order = "sc.pid asc, sc.sort desc, sc.id desc";

        QuerySQL qs = new QuerySQL(WebContext.getPageNo(), WebContext.getPageSize(), field, from, order);
        qs.addWhereWithoutParams("sc.is_deleted = 0 and sc.is_show = 1");

        return this.query(qs, StoreCategoryVo.class);
    }

}
